<template>
	<view class="title-bar u-flex u-row-between u-col-center">
		<view class="left">
			<text>{{this.title}}</text>
		</view>
		<view class="right" @click="toPage">
			<text>更多</text>
			<u-icon name="arrow-right"></u-icon>
		</view>
	</view>
</template>

<script>
	import {mapActions} from 'vuex'
	export default {
		props: {
			title: {
				type: String,
				default: '标题'
			},
			url: {
				type: String,
				default: ''
			}
		},
		methods: {
			...mapActions(['isInPage']),
			toPage(){
				this.$emit('toPage',{url})
				if(this.isInPage(this.url)){
					this.$Router.push(this.url)
				}else{
					this.$Router.pushTab(this.url)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title-bar{
		height: 96rpx;
		background-color: $uni-bg-color;
		padding: 0 25rpx;
		.left{
			font-size: 36rpx;
			font-weight: 500;
			color: #333333;
		}
		.right{
			color: #7D7D7D;
			font-size: $uni-font-size-sm;
		}
	}
</style>
